package com.meizi.codegenerate.tool.page;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;

/**
 * @author GG Bond
 * @date 2023/3/14 - 16:58 - 星期二
 * @project lambda
 * @package com.meizi.codegenerate.tool.page
 * @description 分页工具类
 */
public class PageData<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "总记录数")
    private int total;

    @ApiModelProperty(value = "列表数据")
    private List<T> list;

    @ApiModelProperty(value = "是否有下一页")
    private boolean nextPage;

    public PageData() {
    }

    /**
     * 分页
     *
     * @param list  列表数据
     * @param total 总记录数
     */
    public PageData(List<T> list, long total) {
        this.list = list;
        this.total = (int) total;
    }

}
